<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
*/

//Api 接口
require 'Routes/Admin/Api.php';

Route::group(['prefix' => '/'], function () {
    Route::auth();
});

Route::group(['middleware' => 'auth'], function () {

    Route::group(['namespace' => 'Admin'], function () {

        Route::get('/', 'IndexController@index');
        
        //清楚缓存
        Route::get('clear_cache', 'IndexController@clear_cache');

        //文件上传
        Route::post('upload', 'FileController@upload');
        Route::post('app_upload', 'FileController@app_upload');

        //修改密码
        Route::get('password/edit', 'ConfigController@password');
        Route::patch('password', 'ConfigController@update_password');

        //服务图文
        Route::group(['prefix' => 'hotelreferral'], function () {
            Route::patch('is_something', 'HotelReferralController@is_something');
            Route::delete('destroy_gallery', 'HotelReferralController@destroy_gallery');
            Route::patch('sort_order', 'HotelReferralController@sort_order');
            Route::delete('destroy_checked', 'HotelReferralController@destroy_checked');
        });
        Route::resource('hotelreferral', 'HotelReferralController');

        //图文分类
        Route::group(['prefix' => 'category'], function () {
            Route::patch('is_something', 'CategoryController@is_something');
            Route::patch('sort_order', 'CategoryController@sort_order');
        });
        Route::resource('category', 'CategoryController');

        //视频分类
        Route::group(['prefix' => 'videoCategory'], function () {
            Route::patch('is_something', 'VideoCategoryController@is_something');
            Route::patch('sort_order', 'VideoCategoryController@sort_order');
            Route::delete('destroy_checked', 'VideoCategoryController@destroy_checked');
        });
        Route::resource('videoCategory', 'VideoCategoryController');

        //视频
        Route::group(['prefix' => 'video'], function () {
            Route::patch('is_something', 'VideoController@is_something');
            Route::patch('sort_order', 'VideoController@sort_order');
            Route::delete('destroy_checked', 'VideoController@destroy_checked');
            Route::get('youku_video_list', 'VideoController@youku_video_list');
            Route::post('checked_video', 'VideoController@checked_video');
            Route::post('get_Local_url', 'VideoController@get_Local_url');
            Route::get('onekey_video', 'VideoController@onekey_video');
            Route::get('create_test', 'VideoController@create_test');
            Route::get('video_list', 'VideoController@video_list');
            Route::get('is_episode', 'VideoController@is_episode');
            Route::get('create_video', 'VideoController@create_video');
            Route::get('add_variety', 'VideoController@add_variety');
            Route::get('add_local', 'VideoController@add_local');
            Route::get('add_movie', 'VideoController@add_movie');
        });
        Route::resource('video', 'VideoController');

        //房间号
        Route::group(['prefix' => 'member'], function () {
            Route::patch('sort_order', 'MemberController@sort_order');
        });
        Route::resource('member', 'MemberController');

        //房间号
        Route::group(['prefix' => 'room'], function () {
            Route::patch('sort_order', 'RoomController@sort_order');
        });
        Route::resource('room', 'RoomController');

        //App更新
        Route::group(['prefix' => 'app'], function () {
            Route::patch('is_something', 'AppUpgradeController@is_something');
        });
        Route::resource('app', 'AppUpgradeController');

        //客房点餐
        Route::group(['prefix' => 'product'], function () {
            Route::patch('is_something', 'ProductController@is_something');
            Route::patch('sort_order', 'ProductController@sort_order');
        });
        Route::resource('product', 'ProductController');

        //订单管理
        Route::group(['prefix' => 'order'], function () {
            Route::patch('picking', 'OrderController@picking');
            Route::patch('shipping', 'OrderController@shipping');
            Route::patch('finish', 'OrderController@finish');
        });
        Route::resource('order', 'OrderController');

        //背景图
        Route::group(['prefix' => 'main'], function () {
            Route::delete('destroy_gallery', 'MainController@destroy_gallery');
            Route::patch('is_something', 'MainController@is_something');
        });
        Route::resource('main', 'MainController');
        
    });
});



